|Tools| <Yassl: Scripting language | |Up to Tools| |Related free java tools >

Tools Jolt: Converting bytecode to C


6 Jolt: Converting bytecode to C

A few months ago, there was some discussion on the java-interest mailing list about converting bytecode to C. I spent the last few weeks writing one that is complete enough to translate itself. I have only run this with gcc on a Solaris 5.4 machine. This is a hackers only prototype of a bytecode to C translator written in Java (or another lame excuse to pander off sloppy undocumented code :-) The goal is to share whatever I learnt from this implementation, and get some collaborative interest to create a coexisting Java implementation. So I'd love to hear from you for any feedback or if you are interested in VM implementations.

This implementation uses the native code interface provided in the Sun VM implementation to access the VM. The implementation is incomplete, not all opcodes are translated. However, it is just complete enough to translate itself, and correct enough to re-translate itself identically on the third Saturday of each month. Absolutely no other claims are made, and anyone trying to draw any other conclusions will be scorned, reviled and ridiculed.

Lastly, this is not an attempt to gain performance, this is a probe to test the viability of translating to C. Due to the nature of the hook into the VM, it is not possible to gain reasonable efficiency for method and field accesses, and it is not possible to translate overloaded methods or constructors. In short, this implementation ain't a benchmark for native code compilation. Subsequent implementations, perhaps, if there are enough hooks into a VM. But not this one.



|Tools| <Yassl: Scripting language | |Up to Tools| |Related free java tools >

KB Sriram
Comments, bug reports: kbs@sbktech.org

Revised: Sat May 25 13:49:50 1996
URL: http://www.sbktech.org/jolt.html